
function of( param ){
    if( typeof param === 'number' ){
        return 'number' ;
    }
    if( typeof param === 'boolean' ){
        return 'boolean' ;
    }
    if( typeof param === 'string' ){
        return 'string' ;
    }
    if( typeof param === 'symbol' ){
        return 'symbol' ;
    }
    if( typeof param === 'bigint' ){
        return 'bigint' ;
    }
    if( typeof param === 'undefined' ){
        return 'undefined' ;
    }
    if( typeof param === 'object' && param === null ){
        return 'null' ;
    }
    // 采用 call 方式调用 Object 原型上的 toString 方法
    let s = Object.prototype.toString.call( param );
    let t = s.substring( s.indexOf( ' ' ) + 1 , s.length - 1 );
    return t ;
}

let x = 'hello';
console.log( of( x ) );

x = true ;
console.log( of( x ) );

x = null ;
console.log( of( x ) );

x = undefined ;
console.log( of( x ) );

x = [];
console.log( of( x ) );

x = {}
console.log( of( x ) );

x = new Number( 123 );
console.log( of( x ) );

x = new Date();
console.log( of( x ) );